﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Cheetah_Fast_Banking_App
{
    public partial class NewTransactionForm : Form
    {
        public Transaction GetNewTransaction()
        {
            return _NewTransaction;
        }
        private Transaction _NewTransaction;


        public NewTransactionForm()
        {
            InitializeComponent();
        }

        private void buttonSave_Click(object sender, EventArgs e)
        {
            _NewTransaction = new Transaction(DescriptionTextBox.Text, TransactionDateTime.Value,
                Decimal.Parse(AmountTextBox.Text));

            this.DialogResult = DialogResult.OK;

            this.Hide();
        }

        private void buttonCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
